const install = (Vue, vm) => {
	
	//  获取token
	let getToken      = (params = {}) => vm.$u.get('/weChat/user/getToken', params);
    // 添加用户
    let addUser       = (params = {}) => vm.$u.post('/weChat/user/addUser', params);
	// 获取商品列表
	let getOrderPlans = (params = {}) => vm.$u.post('/weChat/order/getOrderPlans', params);
	// 加入购物车
	let addBuyCar     = (params = {}) => vm.$u.post('/weChat/order/addBuyCar', params);
	//  获取购物数据
	let getCartData   = (params = {}) => vm.$u.get('/weChat/order/getBuyCarData', params);
	//  检测团购信息-轮询接口
	let checkGroupBuyData   = (params = {}) => vm.$u.get('/weChat/order/checkGroupBuyData', params,{},{showLoading:false});
	//  删除购物车
	let delBuyCar   = (params = {}) => vm.$u.post('/weChat/order/delBuyCar', params);
	// 编辑购物车
	let editBuyCar     = (params = {}) => vm.$u.post('/weChat/order/editBuyCar', params);
	// 创建订单
	let addOrder     = (params = {}) => vm.$u.post('/weChat/order/addOrder', params);

	vm.$u.api = {
		getToken,
        addUser,
		getOrderPlans,
		addBuyCar,
		getCartData,
		checkGroupBuyData,
		delBuyCar,
		editBuyCar,
		addOrder
        
	};
}

export default {
	install
}
